Repository navigation
fix(id/serve-proxy): bound credit grants to a finite window ceiling (#8970) - #10977
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Bounds
CreditWindowcredit grants to a finite ceiling (#8970, task 18789).What changed (
pkgs/id/src/serve_proxy.rsonly):CreditWindownow carries an explicitceilingset at construction from the effective configuration (CreditWindow::new(initial, ceiling); a ceiling below the initial grant is raised to it). No universal deployment limit is invented — the design delegates the limit to configuration, so the ceiling is a construction parameter. The built-inper_stream()/per_connection()windows are fixed-size (ceiling = the configured initial credit): a WINDOW_UPDATE can only return credit the sender has actually consumed, which is the design's "credit returns only as bounded buffer space is released" rule.grant()returnsResult<()>: a grant that would exceed the ceiling or overflow is an explicit protocol/resource error and leaves the window unchanged — no more silentsaturating_addtowardu64::MAX. The mux slice maps this error toErrorReason::CreditOverrun, as the module doc already specifies.credit_is_never_exceededproptest oracle is extended (refused grants change neither accounting nor state;available <= ceilingalways), plus unit tests: normal credit return, exact-ceiling grant, over-ceiling refusal with unchanged state, repeatedu32::MAXWINDOW_UPDATE grants, overflow grant, and a configured ceiling above the initial grant.Acceptance mapping: criteria 1 (explicit finite ceiling tied to the effective limits), 2 (over-ceiling/overflow = explicit error, no silent saturation or mutation), and 4 (the named tests) are implemented. Criterion 3 (mux-level accounting) has no mux to enforce against yet — the prior triage (2026-11-12) confirmed no mux/channel/DATA path consumes this primitive in the current source; the primitive now exposes exactly the bounded, error-returning surface the mux slice needs.
Blocker history: the 2026-11-12 triage left this blocked on (a) PR #8971 editing the same file — MERGED 2026-11-14, blocker gone — and (b) the ceiling source, settled here by parameterizing the ceiling instead of hardcoding a deployment limit.
Tests:
cargo test --lib serve_proxy::— 13 passed (incl. the 3 credit tests);cargo fmt --checkclean. Clippy could not run in this environment (nightly toolchain's librustc_driver is missing — pre-existing, unrelated to this change); the crate compiles and tests undercargo test.Refs #8970 (issue stays open for the mux-slice criterion 3).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.